package crm.view.leeds;

import java.awt.event.ActionListener;

import javax.swing.JPanel;
import javax.swing.SpringLayout;
import javax.swing.JTextField;
import javax.swing.JButton;
import java.awt.Font;

public class EnquiryFormView extends JPanel 
{
	private JTextField textField;
	private JTextField tfDate;
	private JButton btnSms;
	private JButton btnMail;
	private JButton btnPrint;
	private JButton btnCl;
	private JButton btnNewButton;
	private CustomerInfoPanel customerInfoPanel;
	private RequirementsPanel requirementsPanel;
	private OfficeUsePanel officeUsePanel;
	private JButton btnSave;
	
	public EnquiryFormView() 
	{
		SpringLayout springLayout = new SpringLayout();
		setLayout(springLayout);

		customerInfoPanel=new CustomerInfoPanel();
		springLayout.putConstraint(SpringLayout.NORTH,customerInfoPanel, 10, SpringLayout.NORTH, this);
		springLayout.putConstraint(SpringLayout.WEST,customerInfoPanel, 10, SpringLayout.WEST, this);
		add(customerInfoPanel);
		
		requirementsPanel=new RequirementsPanel();
		springLayout.putConstraint(SpringLayout.NORTH,requirementsPanel, 10, SpringLayout.NORTH, this);
		springLayout.putConstraint(SpringLayout.WEST,requirementsPanel, 10, SpringLayout.EAST,customerInfoPanel);
		add(requirementsPanel);
		
		officeUsePanel=new OfficeUsePanel();
		springLayout.putConstraint(SpringLayout.NORTH,officeUsePanel, 10, SpringLayout.NORTH, this);
		springLayout.putConstraint(SpringLayout.WEST, officeUsePanel, 10, SpringLayout.EAST, requirementsPanel);
		add(officeUsePanel);
		
		tfDate = new JTextField();
		tfDate.setFont(new Font("MS Reference Sans Serif", Font.PLAIN, 13));
		springLayout.putConstraint(SpringLayout.WEST, tfDate, 10, SpringLayout.WEST,this);
		springLayout.putConstraint(SpringLayout.NORTH, tfDate, 10, SpringLayout.SOUTH,customerInfoPanel);
		add(tfDate);
		tfDate.setColumns(10);
		
		btnCl = new JButton("Cl");
		btnCl.setFont(new Font("MS Reference Sans Serif", Font.PLAIN, 13));
		springLayout.putConstraint(SpringLayout.NORTH, btnCl, 0, SpringLayout.NORTH,tfDate);
		springLayout.putConstraint(SpringLayout.WEST, btnCl, 20, SpringLayout.EAST,tfDate);
		add(btnCl);
		btnCl.setActionCommand("Cl");
		
		btnSave = new JButton("Save");
		btnSave.setFont(new Font("MS Reference Sans Serif", Font.PLAIN, 13));
		springLayout.putConstraint(SpringLayout.NORTH, btnSave, 10, SpringLayout.SOUTH,officeUsePanel);
		springLayout.putConstraint(SpringLayout.WEST, btnSave,30, SpringLayout.EAST,btnCl);
		add(btnSave);
		btnSave.setActionCommand("Save");
		
		btnSms = new JButton("SMS");
		btnSms.setFont(new Font("MS Reference Sans Serif", Font.PLAIN, 13));
		springLayout.putConstraint(SpringLayout.NORTH, btnSms, 0, SpringLayout.NORTH,btnSave);
		springLayout.putConstraint(SpringLayout.WEST, btnSms, 30, SpringLayout.EAST,btnSave );
		add(btnSms);
		btnSms.setActionCommand("Sms");
		
		btnMail = new JButton("EMail");
		btnMail.setFont(new Font("MS Reference Sans Serif", Font.PLAIN, 13));
		springLayout.putConstraint(SpringLayout.NORTH, btnMail, 0, SpringLayout.NORTH, btnSms);
		springLayout.putConstraint(SpringLayout.WEST, btnMail, 30, SpringLayout.EAST,btnSms);
		add(btnMail);
		btnMail.setActionCommand("Mail");
		
		btnPrint = new JButton("Print");
		springLayout.putConstraint(SpringLayout.NORTH, btnPrint, 0, SpringLayout.NORTH,customerInfoPanel );
		btnPrint.setFont(new Font("MS Reference Sans Serif", Font.PLAIN, 13));
		springLayout.putConstraint(SpringLayout.WEST, btnPrint, 30, SpringLayout.EAST,officeUsePanel);
		add(btnPrint);
		btnPrint.setActionCommand("Print");
	}
	
	public CustomerInfoPanel getCustomerInfoPanel() {
		return customerInfoPanel;
	}

	public void setCustomerInfoPanel(CustomerInfoPanel customerInfoPanel) {
		this.customerInfoPanel = customerInfoPanel;
	}

	public RequirementsPanel getRequirementsPanel() {
		return requirementsPanel;
	}

	public void setRequirementsPanel(RequirementsPanel requirementsPanel) {
		this.requirementsPanel = requirementsPanel;
	}

	public OfficeUsePanel getOfficeUsePanel() {
		return officeUsePanel;
	}

	public void setOfficeUsePanel(OfficeUsePanel officeUsePanel) {
		this.officeUsePanel = officeUsePanel;
	}

	public JButton getBtnSave() {
		return btnSave;
	}

	public void setBtnSave(JButton btnSave) {
		this.btnSave = btnSave;
	}

	public void setTextField(JTextField textField) {
		this.textField = textField;
	}

	public void setTfDate(JTextField tfDate) {
		this.tfDate = tfDate;
	}

	public void setBtnSms(JButton btnSms) {
		this.btnSms = btnSms;
	}

	public void setBtnMail(JButton btnMail) {
		this.btnMail = btnMail;
	}

	public void setBtnPrint(JButton btnPrint) {
		this.btnPrint = btnPrint;
	}

	public void setBtnCl(JButton btnCl) {
		this.btnCl = btnCl;
	}

	public void setBtnNewButton(JButton btnNewButton) {
		this.btnNewButton = btnNewButton;
	}

	public JTextField getTextField() {
		return textField;
	}
	public JTextField getTfDate() {
		return tfDate;
	}
	public JButton getBtnSms() {
		return btnSms;
	}
	public JButton getBtnMail() {
		return btnMail;
	}
	public JButton getBtnPrint() {
		return btnPrint;
	}
	public JButton getBtnCl() {
		return btnCl;
	}
	public JButton getBtnNewButton() {
		return btnNewButton;
	}
	public CustomerInfoPanel getCustomerInfo() {
		return customerInfoPanel;
	}
	public RequirementsPanel getRequirements() {
		return requirementsPanel;
	}
	public OfficeUsePanel getOfficeUse() {
		return officeUsePanel;
	}
	
	public void actionListener(ActionListener al)
	{
		btnPrint.addActionListener(al);
		btnMail.addActionListener(al);
		btnSms.addActionListener(al);
		btnSave.addActionListener(al);
		btnCl.addActionListener(al);
	}
}
